package zju.lzy.dto;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author lzy
 */
@Getter
@Setter
public class StatDTO {
    Long timestamp;
    Integer devNum;
    Integer activeDevNum;
    Integer topicNum;
    Integer activeTopicNum;

    StatDTO() {
    }


    public StatDTO(Long timestamp, Integer devNum, Integer activeDevNum, Integer topicNum, Integer activeTopicNum) {
        this.timestamp = timestamp;
        this.devNum = devNum;
        this.activeDevNum = activeDevNum;
        this.topicNum = topicNum;
        this.activeTopicNum = activeTopicNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        StatDTO statDTO = (StatDTO) o;
        return timestamp.equals(statDTO.timestamp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(timestamp);
    }
}
